package com.hockeo.shared.rpc.classic.error;

/**
 * Indicates that a call has been made to a service that requires that the currently
 * connected user is authenticated but the connected user is not known!
 *
 * @version $Id$
 * @author jjanke
 */
public class RpcNotAuthenticatedException extends RpcServerException
{
  private static final long serialVersionUID = 1L;

  private String            d_strLoginUrl;

  /** Default argumentless constructor for GWT/RPC */
  private RpcNotAuthenticatedException()
  {}

  /**
   * Creates a new exception indicating that the connected user is not authenticated.
   *
   * @param strLoginUrl the URL of the login page to which the user should be redirected
   */
  public RpcNotAuthenticatedException( String strLoginUrl )
  {
    d_strLoginUrl = strLoginUrl;
  }

  /**
   * Returns the URL that should be used to get the user logged in.
   */
  public String getLoginUrl()
  {
    return d_strLoginUrl;
  }
}
